package com.deyuanyun.pic.ctrl.enumeration;

/**
 * 缺陷状态
 * @author lijun
 * @date 2016-06-22
 * 
 * History: [修改人][时间][修改描述]
 */
public enum DefectStateEnum {
    state01("01","待审核"),
    //state03("03","审核通过"),
    state04("04","审核未通过"),
    state20("20","已发布");

    private String code;
    private String value;

    private DefectStateEnum(String code,String value){
        this.code = code;
        this.value = value;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static DefectStateEnum getByCode(String code){
        DefectStateEnum[] enumConstants = DefectStateEnum.class.getEnumConstants();
        for(DefectStateEnum  enumItem:enumConstants){
            if(enumItem.getCode().equalsIgnoreCase(code)){
                return enumItem;
            }
        }
        return null;
    }

}
